package com.emmy.like;

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.GestureDetector;
import android.view.MotionEvent;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.Toast;

import com.emmy.likeview.LikeImageView;

public class MainActivity extends AppCompatActivity {

    private EditText likeNum;
    private Button setButton;
    private LikeImageView likeImageView;

    private int num;

    private GestureDetector.SimpleOnGestureListener simpleOnGestureListener;
    private View.OnContextClickListener onContextClickListener;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        init();
    }

    private void init(){
        likeNum = (EditText)findViewById(R.id.likeNum);
        setButton = (Button)findViewById(R.id.set);
        likeImageView = (LikeImageView)findViewById(R.id.likeView);

        setButton.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                num = Integer.parseInt(likeNum.getText().toString());
                likeImageView.setLikeNumber(num);
            }
        });

        simpleOnGestureListener = new GestureDetector.SimpleOnGestureListener(){
            @Override
            public boolean onDoubleTap(MotionEvent e) {
                return super.onDoubleTap(e);
            }
        };


    }
}
